package com.stud.framework.proxy;

import com.stud.common.utils.StringUtils;

/**
 * @author Stud
 * @title XXXXX
 * @desription XXXXX
 * @data 2023-03-10 18:42
 */
public class StringBuilderProxy {
    private StringBuilder sb = new StringBuilder();

    public StringBuilderProxy append(Object o) {
        if (!StringUtils.isBlank(o)) {
            sb.append(o);
        }
        return this;
    }

    public StringBuilder get() {
        return sb;
    }

    public void setLength(int newLength) {
        sb.setLength(newLength);
    }

    public int length() {
        return sb.length();
    }

    public String toString() {
        if (sb == null) {
            return null;
        }
        return sb.toString();
    }
}
